﻿#查找路径下面所有源文件
aux_source_directory(. SRC_LIST)

#引用库名
set(MY_LIBS commonLibUtil)
set(LINK_LIST "")
foreach(x ${MY_LIBS})
    list (APPEND LINK_LIST debug ${x}_gd optimized ${x})
endforeach()


#生成exe文件
ADD_EXECUTABLE(Util ${SRC_LIST})

#添加库
target_link_libraries(Util ${LINK_LIST})

#设置预编译
SET_TARGET_PROPERTIES(Util PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h")
cotire(Util)

#设置目录
set_target_properties(Util PROPERTIES FOLDER "Test")

install(TARGETS Util 
        RUNTIME DESTINATION ${PROJECT_BINARY_DIR}/bin)


